package com.honglu.backend.utils;

import java.util.LinkedHashMap;
import java.util.Map;

/**
* 
* @author gdl
* @version 1.0
*/
public enum CodeUtils {
	
	SUCCESS("200","成功",true),
	FAIL("500","失败",false),
	SAVE_SUCCESS("2001","保存成功", true),
	SAVE_FAIL("2002","保存失败",false),
	DELETE_SUCCESS("3001","删除成功",true),
	DELETE_FAIL("3002","删除失败",false),
	UPDATE_SUCCESS("4001","修改成功",true),
	UPDATE_FAIL("4002","修改失败",false),
	LINEON_SUCCESS("5001","发布成功",true),
	LINEON_FAIL("5002","发布失败",false),
	QUERRYSUCCESS("200","查询成功",true),
	QUERRYFAIL("500","查询失败",false),
	SUCCESSNEWS("101","返回成功。",true),
	NAME_FAIL("102", "已存在", false),
	IMAGE_UPLOAD_FAILUE_TYPE("1011","上传的文件类型错误，请上传GIF、PNG、JPG图片！",false),
	BACKEND_ERROR("-200","程序异常请联系管理员",false),// 说明，BACKEND开头是后台系统定义
	PARAMS_ERROR("500","参数错误", true),
	PARAMS_NULL("500","参数为空", true),
	QUERY_NULL("200","查询结果为空",true),
	BACKEND_PRA_MISS("6001","缺少参数",false),
	QUERY_SUCCESS("200","查询成功",true),
	BACKEND_OPT_ERROR("6002","操作失败",false);
	
	private String code;//错误码
	private String message;//错误消息
	private Boolean flag;//返回状态
	
	private CodeUtils(String code, String message,Boolean flag) {
		this.code = code;
		this.message = message;
		this.flag = flag;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Boolean getFlag() {
		return flag;
	}

	public void setFlag(Boolean flag) {
		this.flag = flag;
	}
	
}
